<template>
    <div class="Homepruduct">
        <div class="bananer">
            <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
                <van-swipe-item v-for="(imgs, index) of bananer" :key="index">
                    <img :src="imgs.list_pic_url" alt="" />
                </van-swipe-item>
            </van-swipe>
        </div>
        <ProductPage :pruductLi="recommenProduct"></ProductPage>
    </div>
</template>

<script>
import ProductPage from "../components/ProductPage"
import { getProduct,getHomelist }from "../api/api"
export default {
    name: 'YxHomepruduct',
    components:{ProductPage},
    data() {
        return {
            bananer:{},
            recommenProduct:{}
        };
    },
   created() {
    getHomelist().then((res)=>{
          this.bananer = res.data.newGoodsList;
    })
   },
    mounted() {
        // 取到id
        // 发起分类接口
        // 显然页面
        console.log(this.$route.query.name)
        getProduct(this.$route.query.name).then((res)=>{
              this.recommenProduct = res.data.data;
        })
    },

    methods: {
        
    },
};
</script>

<style lang="scss" scoped>
    .Homepruduct{
        height: 100%;
    }
.bananer{
    background-color:seashell;
    img{
        width: 7.5rem;
        height:4rem;
    }
}
</style>